package com.lyncs.ods.modules.txn.service;

import com.lyncs.ods.constant.LyncsOdsConstant;
import com.lyncs.ods.modules.txn.model.TxnOperateInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * ods操作信息 服务类
 * </p>
 *
 * @author alex
 * @since 2022-04-09
 */
public interface TxnOperateInfoService extends IService<TxnOperateInfo> {

    /**
     * 获取置顶单据ID
     *
     * @param companyId companyId
     * @param type      单据类型：1.order;2.deliver;3.settlement
     * @return ids
     */
    List<Long> getTopTicket(Long companyId, Integer type);

    /**
     * 改单据是否被置顶
     *
     * @param companyId companyId
     * @param type      type->ods
     * @param ticketId  ods Id
     * @return t/f
     */
    Boolean isTopTicket(Long companyId, Integer type, Long ticketId);

    void saveTopTicket(@NotNull LyncsOdsConstant.TxnType txnType, @NotNull Long refId, Integer type);
}
